import request from '@/router/axios';
import {downloadExcel} from '@/router/axios';
import {formatCondition} from '@/util/util';
//单条查询
export const querySysLog = (params) => {
  params.head.transCode = 'querySysLog';
  return request({
    url: '/platform/sysLog/querySysLog',
    method: 'post',
    data: params
  })
}
//多条列表查询，支持条件查询
export const querySysLogListPage = (params) => {
  params.head.transCode = 'querySysLogListPage';
  return request({
    url: '/platform/sysLog/querySysLogListPage',
    method: 'post',
    data: params
  })
}
//新增单条记录
export const saveSysLog = (params) => {
  params.head.transCode = 'saveSysLog';
  return request({
    url: '/platform/sysLog/saveSysLog',
    method: 'post',
    data: params
  })
}
//新增多条记录
export const saveSysLogList = (params) => {
  params.head.transCode = 'saveSysLogList';
  return request({
    url: '/platform/sysLog/saveSysLogList',
    method: 'post',
    data: params
  })
}
//新增或修改单条记录
export const saveOrUpdateSysLog = (params) => {
  params.head.transCode = 'saveOrUpdateSysLog';
  return request({
    url: '/platform/sysLog/saveOrUpdateSysLog',
    method: 'post',
    data: params
  })
}


//新增或修改单条记录
export const saveOrUpdateSysLogList = (params) => {
  params.head.transCode = 'saveOrUpdateSysLogList';
  return request({
    url: '/platform/sysLog/saveOrUpdateSysLogList',
    method: 'post',
    data: params
  })
}

//修改单条记录
export const updateSysLog = (params) => {
  params.head.transCode = 'updateSysLog';
  return request({
    url: '/platform/sysLog/updateSysLog',
    method: 'post',
    data: params
  })
}

//删除单条记录
export const deleteSysLog = (params) => {
  params.head.transCode = 'deleteSysLog';
  return request({
    url: '/platform/sysLog/deleteSysLog',
    method: 'post',
    data: params
  })
}

//删除多条记录
export const deleteSysLogList = (params) => {
  params.head.transCode = 'deleteSysLogList';
  return request({
    url: '/platform/sysLog/deleteSysLogList',
    method: 'post',
    data: params
  })
}
//导出excel
export const exportSysLogExcel = (params) => {
  downloadExcel({
    url: '/platform/sysLog/excelDownload/exportSysLogExcel',
    method: 'get',
    data: 
    {
      tenantId: params.head.tenantId,
      orders:'',
      condition: formatCondition(params.body.sqlCondition)
    }
  })
}
//单条查询
export const queryLogType = (params) => {
  params.head.transCode = 'queryLogType';
  return request({
    url: '/platform/sysLog/queryLogType',
    method: 'post',
    data: params
  })
}